package com.ljh.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ljh.dao.ArticleMapper;
import com.ljh.pojo.Article;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArticleService {

    @Autowired
    ArticleMapper articleMapper;

    public PageInfo<Article> findUserByPage(int pageNum,int pageSize){

        PageHelper.startPage(pageNum,pageSize);
        List<Article> articleList = articleMapper.findArticlePage();
        PageInfo<Article> articlePageInfo = new PageInfo<>(articleList);
        return articlePageInfo;

    }
}
